package com.atguigu.gulimall.product;

import com.alibaba.fastjson.JSON;
import com.atguigu.gulimall.product.dao.AttrGroupDao;
import com.atguigu.gulimall.product.dao.SkuSaleAttrValueDao;
import com.atguigu.gulimall.product.vo.ItemSaleAttrsVo;
import com.atguigu.gulimall.product.vo.SkuItemAttrGroupVo;
import com.atguigu.gulimall.product.vo.SkuItemVo;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

import javax.annotation.Resource;
import java.util.List;

@SpringBootTest
@RunWith(SpringRunner.class)
public class 测试商品详情信息 {
    @Resource
    private AttrGroupDao attrGroupDao;
    @Resource
    private SkuSaleAttrValueDao skuSaleAttrValueDao;
    @Test
    public void testAttrGroupDao(){
        List<SkuItemAttrGroupVo> attrGroupWithAttrsBySpuId = attrGroupDao.getAttrGroupWithAttrsBySpuId(5l, 225l);
        String s = JSON.toJSONString(attrGroupWithAttrsBySpuId);
        System.out.println(s);
    }

    @Test
    public void testSkuSaleAttrValueDao(){
        List<ItemSaleAttrsVo> saleAttrsBySpuId = skuSaleAttrValueDao.getSaleAttrsBySpuId(7l);
        String s = JSON.toJSONString(saleAttrsBySpuId);
        System.out.println(s);
    }

}
